const testLines = [
  '        int a = 10;',
  '        int b = 20;',
  '        int result = a + b;'
];

testLines.forEach((line, i) => {
  console.log('第' + (i+1) + '行: ' + line);
  
  // 复制extractVariableDeclarations的模式
  const patterns = [
    /\b(\w+(?:<[^>]+>)?(?:\[\])?)\s+(\w+)\s*=\s*[^;]+;/g,
    /\b(\w+(?:<[^>]+>)?(?:\[\])?)\s+(\w+)\s*;/g,
    /for\s*\(\s*(\w+(?:<[^>]+>)?)\s+(\w+)\s*:/g,
    /catch\s*\(\s*(\w+)\s+(\w+)\s*\)/g
  ];
  
  patterns.forEach((pattern, j) => {
    pattern.lastIndex = 0;
    let match;
    while ((match = pattern.exec(line)) !== null) {
      console.log('  模式' + (j+1) + '匹配: ' + match[1] + ' ' + match[2]);
    }
  });
});